#include "GY_ClippingToolContainer.h"
#include <QDebug>

GY_ClippingToolContainer::GY_ClippingToolContainer(const QString &guid, QGraphicsItem *parent) : GY_ContainerTransform(guid,this, parent)
{
    setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemClipsChildrenToShape);
}

QPainterPath GY_ClippingToolContainer::shape() const
{
//    qDebug() << this->getGuid() << this->childrenBoundingRect();
    if(!m_isCut) {
        return QGraphicsItemGroup::shape();
    }
    return m_shape;
}

void GY_ClippingToolContainer::setShape(const QPainterPath &shape)
{
    m_shape = shape;
    update();
}

void GY_ClippingToolContainer::setIsCut(const bool &isCut)
{
    m_isCut = isCut;
}
